from DataManagement.models import DataCenterModel
from gxdm.models import *
from gxxx.models import Gxxx06
from django.db import models


'''
班级数据子集
'''


class Gxxx04(DataCenterModel):
    class Meta(DataCenterModel.Meta):
        db_table = 'gxxx04'
        verbose_name = 'GXXX04 班级信息'
        verbose_name_plural = 'GXXX04 班级信息'

    bh = models.CharField('班号', max_length=32, unique=True, primary_key=True)
    # dwh = models.CharField('院系', max_length=32, choices=Code.FACULTY_CHOICE, blank=True, null=True)
    dwh = models.ForeignKey(Dwbmdm, to_field='value', related_name='xx_04_dwh', on_delete=models.PROTECT,
                             db_column='dwh', verbose_name="院系所号", blank=True, null=True)
    zym = models.ForeignKey(Gxxx06, to_field="zybh", on_delete=models.PROTECT, verbose_name='专业', blank=True, null=True)
    bjmc = models.CharField('班级名称', max_length=32)
    jbny = models.CharField('建班年月', max_length=32, blank=True, null=True)
    ssnj = models.CharField('所属年级', max_length=32, blank=True, null=True)
    bzrgh = models.CharField('班主任工号', max_length=32, blank=True, null=True)
    bzxh = models.CharField('班长学号', max_length=32, blank=True, null=True)
    fdyh = models.CharField('辅导员号', max_length=32, blank=True, null=True)
    sfddb = models.CharField('是否订单班', max_length=32, blank=True, null=True)
    # xqh = models.CharField('校区号', max_length=32, choices=Xxqdm, blank=True, null=True)
    xqh = models.ForeignKey(Xxqdm, to_field='value', related_name='xx_04_xqh', on_delete=models.PROTECT,
                             db_column='xqh', verbose_name="校区号", blank=True, null=True)
    bjlx = models.IntegerField('班级类型')

    def __str__(self):
        return self.bjmc
